/**
 * Created with IntelliJ IDEA.
 * User: Инесса
 * Date: 07.10.13
 * Time: 21:02
 * To change this template use File | Settings | File Templates.
 */
import java.util.Arrays;
import java.util.Scanner;

public class Divider {
    public static int fractionalNumbers = 5;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int number = in.nextInt();
        int divider = in.nextInt();
        printData(number,divider);
    }

    /**
     * Method for printing data
     * @param number
     * @param divider
     */

    private static void printData(int number, int divider) {
        for (int[] data  : divide(number, divider)) {
            System.out.printf("%3d %3d %3d\n", data[0], data[1], data[2]);
        }
        System.out.println("Exact value=" + 1.0 * number / divider);
    }

    private static int charToInt(char ch) {
        return ch - 48; // ASCII digits start from 48 symbol
    }

    /**
     * Method for dividing
     * @param number
     * @param divider
     * @return
     */

    private static int[][] divide(int number, int divider) {
        String numeric = String.valueOf(number);
        int[][] results = new int[100][];
        int i = 0, tail = 0, value = 0, it = 0;
        while (i < numeric.length() || tail < fractionalNumbers) {
            value *= 10;
            if (i < numeric.length()) {
                value += charToInt(numeric.charAt(i++));
            } else if (value != 0) {
                tail++;
            } else if (value == 0) break;
            results[it++] = new int[] { value, value / divider, value % divider };
            value %= divider;
        }
        return Arrays.copyOf(results, it);
    }
}